﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.Depo.Westbrook
{
    public partial class StylesTR : XForm
    {
        public StylesTR()
        {
            InitializeComponent();
        }

        private void Styles_Load(object sender, EventArgs e)
        {
            
            gvStyles.Init("GetWBStylesAsTR");

            gvStyles.SetFilterTypeToCheckedList("Style");
            gvStyles.BestFitColumns();
            btnUpdate.ItemClick += btnUpdate_ItemClick;
        }

        void btnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gvStyles.RefreshDataSource("GetWBStylesAsTR");
        }

        private string GetIdx()
        {
            string idxs = "";
            foreach (int rowHandle in gvStyles.GetSelectedRows())
                if (rowHandle > -1)
                    idxs += gvStyles.GetRowCellValue(rowHandle, "StyleId").ToString() + ",";

            idxs = idxs.RemoveIfEndsWith(",");

            return idxs;
        }
    }
}